Universal Serial Bus (USB) is a standard developed to allow plug and play or hot swapping connectivity and to replace legacy serial and parallel ports between a host and peripheral devices. USB corresponds to a polled bus in which one or more attached peripheral devices (i.e., USB devices) share a bus bandwidth through a host-scheduled protocol. A USB device is allowed to be attached, configured, used, and detached while the host and other USB devices are operating.
Usually, USB data transfer occurs between a host and a USB device. When a USB device is first connected to a host, an enumeration process begins. A reset signal is sent to the USB device to determine a data rate of the USB device. Then, information associated with the USB device is read by the host and the USB device is assigned a unique address. A host controller directs raffle flow from/to the USB device. For example, the host controller executes USB operations to move data between host memory and device endpoints, where each device endpoint corresponds to a uniquely addressable portion of a USB device that is the source or sink of data in a communication flow between the host and the USB device.
Four basic types of data transfers are supported by USB specifications: control data transfer, bulk data transfer, interrupt data transfer, and isochronous data transfer. The control data transfer is often used for non-periodic, host software-initiated request/response communication (e.g., for command/status operations). The bulk data transfer is usually used for non-periodic, large-packet communication that can use any available bandwidth and can be delayed until the bandwidth is available. For example, data received by a printer in one big packet may be transferred using the bulk data transfer. In addition, the interrupt data transfer is often used for low-frequency, bounded-latency communication. For example, a mouse or a keyboard that sends very little data may use the interrupt data transfer. The isochronous data transfer, known also as streaming real time transfer, is usually used for periodic, continuous communication between a host and a USB device (e.g., communication involving time-sensitive information). For example, a streaming device (e.g., an audio speaker) may use the isochronous data transfer.
USB data transfers are scheduled by the host controller. For example, periodic data transfers, such as the isochronous data transfer and the interrupt data transfer, often have strict timing requirements, and thus need to move across the bus in a timely manner. Non-periodic data transfers, such as the bulk data transfer and the control data transfer, often do not have strict timing requirements. To ensure synchronization between the host and USB devices, the bus time is often divided into fixed-length segments. For low-speed or full-speed buses, the bus time is divided into 1 millisecond units, i.e., frames. For a high-speed bus, the bus time is divided into 125 microsecond units, i.e., microframes. A microframe includes multiple data packets, and a data packet includes 1 kbytes.